package com.sc.consumber_feign.service;


import com.sc.consumber_feign.entity.Goods;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;

@FeignClient(value = "producer-service-jpa",fallback = RemoteFeignServiceFallBack.class)
public interface RemoteFeignService {
    @RequestMapping(value = "/goodss",method = RequestMethod.GET)
    public List<Goods> findGoods();

    @RequestMapping(value = "/goods/{id}",method = RequestMethod.GET)
    public Goods findOneGoods(@PathVariable(value = "id") int id);

    @RequestMapping(value = "/goods",method = RequestMethod.POST)
    public Goods addGoods(@RequestBody Goods goods);


    @RequestMapping(value = "/goods",method = RequestMethod.PUT)
    public Goods updateGoods(@RequestBody Goods goods);

    @RequestMapping(value = "/goods/{id}",method = RequestMethod.DELETE)
    public Boolean deleteGoods(@PathVariable(value = "id") int id);
}
